-------------------------------- DarkRp Hack ---------------------------------
function RPSlobBotAllowed(ent)
	-- HAD TO USE THIS BECAUSE TABLES ONLY TRIGGER FIRST 2 ITEMS FOR SOME REASON
	if !(ent:IsValid()) then return false end 
	if (ent:GetClass() == nil) or (ent:GetClass() == "") or (string.find(ent:GetClass(), "physgun")) or (ent:GetOwner() == minge) then 
		return false 
	end
	if string.find(ent:GetClass(), "drug") or string.find(ent:GetClass(), "food") or
	string.find(ent:GetClass(), "drug") or string.find(ent:GetClass(), "gun") or
	string.find(ent:GetClass(), "melon") or string.find(ent:GetClass(), "money") or
	string.find(ent:GetClass(), "spawned") or string.find(ent:GetClass(), "microwave") or
	ent:GetModel() == "models/props/cs_assault/money.mdl" then
		return true
	else
		return false
	end
end

function SlobDarkRPHack()
	DarkRPWallhackEnabled = true
	hook.Add("HUDPaint", "DarkRPESP", function()
		for _, ent in pairs(ents.GetAll()) do
			if RPSlobBotAllowed(ent) then
				local rpepos = ent:GetPos()
				if rpepos:ToScreen().x > 0 and
				rpepos:ToScreen().y > 0 and
				rpepos:ToScreen().x < ScrW() and
				rpepos:ToScreen().y < ScrH() then
	                local rppos1 = (ent:LocalToWorld( Vector(0,0,0)) ):ToScreen()
                    if ent:GetModel() != "models/props/cs_assault/money.mdl" then
						draw.SimpleTextOutlined("Class: "..ent:GetClass(), "ScoreboardText", rppos1.x, rppos1.y, Color(0, 0, 255, 255), 2, 1, 1, Color(255, 255, 255, 255))
					else
						draw.SimpleTextOutlined("MONEY", "ScoreboardText", rppos1.x, rppos1.y, Color(0, 0, 255, 255), 2, 1, 1, Color(255, 255, 255, 255))
					end
				end
			end
		end
	end)
end

concommand.Add("wots_togglerphack", function()
    if DarkRPWallhackEnabled then
	    hook.Remove("HUDPaint", "DarkRPESP")
        SlobNotify("DarkRP mode: OFF")
		DarkRPWallhackEnabled = false
	elseif !DarkRPWallhackEnabled then
        SlobDarkRPHack()
        SlobNotify("DarkRP Mode: ON")
		DarkRPWallhackEnabled = true
    end
end)
-------------------------------------------------------------------------------